#include <iostream>
using namespace std;

class MathItem
{
public:
    MathItem(int x);
    MathItem(int x, double y);
    int getFull() const;
    double getCents() const;
    void output();

private:
    int full;
    double cents;
};

const MathItem operator+(const MathItem &item1, const MathItem &item2);
const MathItem operator-(const MathItem &item1, const MathItem &item2);

int main()
{
    MathItem item1(2, 0.2), item2(5);
    item1.output();
    item2.output();
    MathItem item3 = item1 + item2;
    item3.output();
    MathItem item4 = item1 - item2;
    item4.output();

    return 0;
}

MathItem::MathItem(int x, double y) : full(x), cents(y)
{
}

MathItem::MathItem(int x) : full(x), cents(0.1)
{
}

int MathItem::getFull() const
{
    return full;
}

double MathItem::getCents() const
{
    return cents;
}

const MathItem operator+(const MathItem &item1, const MathItem &item2)
{
    int full_part = item1.getFull() + item2.getFull();
    double cents_part = item1.getCents() + item2.getCents();
    return MathItem(full_part, cents_part);
}

const MathItem operator-(const MathItem &item1, const MathItem &item2)
{
    int full_part = item1.getFull() - item2.getFull();
    double cents_part = item1.getCents() - item2.getCents();
    return MathItem(full_part, cents_part);
}

void MathItem::output()
{
    cout << "The full part is " << full << " and the cents part is " << cents << endl;
}